const ENV = process.env.NODE_ENV
const SERVER_DOMAIN = ENV === 'production' ? '47.96.62.199/eduMobile/mobile' : '47.96.62.199/eduMobile/mobile'

// 正式
// const SERVER_DOMAIN = ENV === 'production' ? 'qqc.hztangong.com/a' : '114.55.103.65:8089/a
// const SERVER_DOMAIN = ENV === 'production' ? window.location.host : '114.55.103.65:8087/app'
// const SERVER_DOMAIN = ENV === 'production' ? window.location.host : '192.168.0.118:8080/qsng_wx/app'
const SERVER_HOST = 'http://' + SERVER_DOMAIN + '/'
const API = {
  // 注册 post
  REGIST: 'student/regist.do',
  // 退出登录
  LOGOUT: 'student/logout',
// 登录 POST
  LOGIN: 'student/login',
  // 培训
  // 课程列表 get
  CLASSLISTDO: 'front/clazzList.do',
  //教师点到课程列表
  BSPCLASSLIST: 'teacher/bspClazzList.do',
  // 全国区域列表 get  该接口没有用到
  ZONELIST: 'common/zoneList',
  // 机构区域 get
  AREALIST: 'common/areaList.do',
  // 单位学期 get
  TERMLIST: 'common/termList.do',
  // 专业分类 get
  SPECIALTYLIST: 'common/specialtyList.do',
  // 时间段 get
  WEEKLIST: 'common/weekList.do',
  // 课程详情 get
  CLAZZVIEW: '/front/clazzView.do',
  // 教师点到课表 get
  SIGNCLASSSCHEDULE: 'teacher/signClassSchedule.do',
  // 教师点到学生列表 get
  NEWSIGNSTUDENTLIST: 'teacher/newSignStudentList.do',
  // 教师点到修改 post
  SIGNEDIT: 'teacher/signEdit.do',
  // 教师点到新增 post
  SIGNADD: 'teacher/signAdd.do',
  // 班级报名 POST
  CLASSAPPLY: 'front/clazzApply.do',
  // 通知
  // 我的通知 get
  NOTICELIST: 'student/noticeList.do',
  // 通知详情 GET
  NOTICEVIEW: 'student/noticeView.do',

  // 我的
  // 账户信息 get
  STUDENTVIEW: 'student/studentView.do',
  // 机构配置 获取身份证是否必填 GET
  SETTING: 'common/setting.do',
  // 年级段 GET
  GRADELIST: 'common/gradeList.do',
  // 我的点到 今日点到 GET
  STUDENTSIGNTODAY: 'student/signToday.do',
  // 我的点到 点到统计 GET
  SIGNTERM: 'student/signTerm.do',
  // 点到详情 GET
  SIGNLIST: 'student/signList.do',
  // 我的班级 GET
  CLASSLIST: 'student/clazzList.do',
  // 修改个人信息 POST
  EDITPROFILE: 'student/editprofile.do',
  //根据预约号查询我的报名班级详情   get
  QUERYBYRESERVENO: 'front/searchApply.do',
  NOTIFYAPI: 'api/notify.do',
  GETAPPKEY: 'getAppKey',
  STUDENTSCHEDULE: 'student/schedule.do' //  get
}

const output = {}
for (let key in API) {
  output[key] = SERVER_HOST + API[key]
}
output['SERVER_DOMAIN'] = SERVER_DOMAIN
output['SERVER_HOST'] = SERVER_HOST
output['ENV'] = ENV
//output['PAYMENT_API'] = 'http://txzfzx.hztangong.com/zfzx'

output['PAYMENT_API'] = 'http://localhost:8080'

module.exports = output
